package package_demo;

import java.util.Scanner;

public class ScannerTest {
    public  static void demo(){
        Scanner s = new Scanner(System.in);
        String str = s.next();//程序运行到next会阻塞，等待键盘输入
        System.out.println(str);
    }
    public  static void demo1(){
        Scanner s = new Scanner(System.in);
        System.out.println("输入第一个数字");
        int a = s.nextInt();
        System.out.println("输入第二个数字");
        int b = s.nextInt();
        System.out.println("sum="+(a+b));
    }
    public  static void main(String[] args){
        demo1();
    }
}
